<!DOCTYPE html>
<html>

<head>
	<meta charset="utf-8">
	<title>订单管理</title>
	<meta name="viewport" content="width=device-width, initial-scale=1,maximum-scale=1,user-scalable=no">
	<meta name="apple-mobile-web-app-capable" content="yes">
	<meta name="apple-mobile-web-app-status-bar-style" content="black">
	<link rel="stylesheet" href="../m/css/common/mui.min.css">
	<link rel="stylesheet" href="../m/css/common/mui.extra.css">
	<link rel="stylesheet" href="../m/css/common/common.css">
	<style>
		.mui-input-group:before,
		.mui-input-group:after,
		.mui-input-group .mui-input-row:after,
		.mui-table-view:before,
		.mui-table-view:after {
			background: none !important;
		}
	</style>
</head>

<body class="cj-bg-light-grey">
	<header class="mui-bar mui-bar-nav mui-white-nav-bar">
		<h1 class="mui-title">订单管理</h1>
	</header>
	<div class="cj-line-20"></div>
	<div class="mui-content cj-bg-light-grey">
		<form method="post" id='login-form' class="mui-input-group ">
			<div class="mui-input-row">
				<label>账号</label>
				<input name="username" type="text" class="mui-input-clear mui-input" placeholder="用户名">
			</div>
			<div class="mui-input-row mui-password">
				<label>密码</label>
				<input name="password" type="password" class="mui-input-clear mui-input" placeholder="密码">
			</div>
		</form>
		<div class="cj-line-10"></div>

		<div class="cj-line-10"></div>
		<div class="mui-content-padded">
			<button id='login' data-loading-text="登陆中" class="mui-btn mui-btn-block mui-btn-primary cj-btn">登录</button>
			<div class="cj-line-10"></div>

		</div>
		<div class="mui-content-padded oauth-area">
		</div>
	</div>
	<script src="../m/js/common/mui.min.js"></script>
	<script src="../m/js/common/mui.href.js"></script>
	<script src="../m/js/common/jquery.min.js"></script>
	<script src="../m/js/common/common.js"></script>
	<script src="../m/js/common/public.js"></script>
	<script>
		autoLogin(0,1);
		var usernameInput = $("input[name='username']");
		var passwordInput = $("input[name='password']");
		$("#login").click(function() {
			 var username = usernameInput.val();
			if (username == "") {
				mui.toast("请输入用户名");
				return;
			}

			var password = passwordInput.val();
			if (password == null || password == "") {
				mui.toast("请输入密码" + password);
				return;
			}

			$.ajax({
				url: "/admin/login",
				data:{
					'account':username,
					'password':password
				},
				type: 'post',
				dataType: 'json',
				beforeSend: function() {

				},
				success: function(response) {
					if(response.code==500){
						mui.toast(response.msg);
					}else if(response.code==200){
						localStorage.username = username;
						localStorage.password = password;
						location.href = '/admin/m/';
						mui.toast('登陆成功');
					}

				}
			});
		});
	</script>
</body>

</html>
